package com.sw.service;




import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sw.model.Person;

@RequestMapping("/test")
@Controller
public interface IPersionService {

	@RequestMapping(value = "/hello",produces = "text/plain;charset=UTF-8")
	public @ResponseBody String hello();
	
	@RequestMapping(value = "/say/{msg}",
			produces = "application/json;charset=UTF-8")
	public @ResponseBody  
	    String say(@PathVariable(value = "msg") String msg);
	
	@RequestMapping(value = "/person/{id:\\d+}",
			method = RequestMethod.GET,
			produces = "application/json;charset=UTF-8")  
    public @ResponseBody  
    	String getPerson(@PathVariable("id") int id);
	
	@RequestMapping(value = "/person/{id:\\d+}",
			method = RequestMethod.DELETE)  
    public @ResponseBody
    	Object deletePerson(@PathVariable("id") int id) ;  
      
    /** 
     * 添加
     * @param person 
     * @return 
     */  
    @RequestMapping(value = "/person/add", method = RequestMethod.POST)  
    public @ResponseBody String addPerson(@RequestBody Person person);  
      
     /**
      * 修改
      * @param person
      * @return
      */
    @RequestMapping(value = "/person", method = RequestMethod.PUT)  
    public @ResponseBody Object updatePerson(@RequestBody Person person);
}
